//
//  Request+Header.swift
//  ASW
//
//  Created by zhuxuhong on 2020/12/2.
//

import Foundation

extension Request {
    public enum Header {
        static let ContentTypeKey = "Content-Type"
        static let AuthorizationKey = "Authorization"
        static let TokenKey = "Token"
        static let AccessTokenKey = "Access_Token"
    }
}

extension Request.Header {
    public enum ContentType: String {
        case json = "application/json"
        case formData = "multipart/form-data"
        case formUrlEncoded = "application/x-www-form-urlencoded"
        public var headers: Request.Headers {
            return [ContentTypeKey: rawValue]
        }
    }
    public enum Authorization {
        case basic(token: String)
        public var value: String {
            switch self {
            case .basic(let token):
                return token
            }
        }
    }
}
